package com.fashionista;

import android.app.TabActivity;
import android.content.Intent; 
import android.content.res.Resources;
import android.os.Bundle; 
import android.widget.TabHost;

/**
 * Class acting as container for all other tab classes
 * 
 * @author Trevor Adelman, Patrick Koperwas, Tong Wu, Shayan Yassami
 * @version for cs48 group project, 3/11/2011
 */
public class Fashionista extends TabActivity {

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Resources res = getResources(); // Resource object to get Drawables
    TabHost tabHost = getTabHost();  // The activity TabHost
    TabHost.TabSpec spec;  // Resusable TabSpec for each tab
    Intent home, outfit, wardrobe, events;  // Creates Intents to open new pages

    // Create an Intent to launch an Activity for the tab (to be reused)
    home = new Intent().setClass(this, HomeActivity.class);

    // Initialize a TabSpec for each tab and add it to the TabHost
    spec = tabHost.newTabSpec("home").setIndicator("Home",
                     res.getDrawable(R.drawable.home))
                  .setContent(home);
    tabHost.addTab(spec);

    // Do the same for the other tabs
    outfit = new Intent().setClass(this, OutfitActivity.class);
    spec = tabHost.newTabSpec("outfit").setIndicator("Outfit",
                    res.getDrawable(R.drawable.outfit))
                  .setContent(outfit);
    tabHost.addTab(spec);

    wardrobe = new Intent().setClass(this, WardrobeActivity.class);
    spec = tabHost.newTabSpec("wardrobe").setIndicator("Wardrobe",
                    res.getDrawable(R.drawable.wardrobe1))
                  .setContent(wardrobe);
    tabHost.addTab(spec);
    
    events = new Intent().setClass(this, EventsActivity.class);
    spec = tabHost.newTabSpec("events").setIndicator("Events",
    		res.getDrawable(R.drawable.events))
    		.setContent(events);
    tabHost.addTab(spec);
    
    tabHost.setCurrentTabByTag("home");
}
}